﻿/*------------------------------------------------
// File Description: DeliveryOrder DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-05-11 15:38:25
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 发货单
    /// </summary>
    [Table(nameof(DeliveryOrder))]
    public class DeliveryOrder : BaseEntity
    {
        private string _deliveryNo = string.Empty;
        private string _customerCode = string.Empty;
        private string _customerName = string.Empty;
        private string _contractNo = string.Empty;
        private string _warehouseCode = string.Empty;
        private string _warehouseName = string.Empty;
        private string _orderNo = string.Empty;

        #region Public Property
        ///<Summary>
        /// 发货单号
        ///</Summary>
        public string DeliveryNo
        {
            get { return string.IsNullOrWhiteSpace(_deliveryNo) ? string.Empty : _deliveryNo; }
            set { _deliveryNo = value; }
        }

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 发货日期
        ///</Summary>
        public DateTime? DeliveryDate { get; set; }

        ///<Summary>
        /// 客户代码
        ///</Summary>
        public string CustomerCode
        {
            get { return string.IsNullOrWhiteSpace(_customerCode) ? string.Empty : _customerCode; }
            set { _customerCode = value; }
        }

        ///<Summary>
        /// 客户名称
        ///</Summary>
        public string CustomerName
        {
            get { return string.IsNullOrWhiteSpace(_customerName) ? string.Empty : _customerName; }
            set { _customerName = value; }
        }

        ///<Summary>
        /// 合同编号
        ///</Summary>
        public string ContractNo
        {
            get { return string.IsNullOrWhiteSpace(_contractNo) ? string.Empty : _contractNo; }
            set { _contractNo = value; }
        }

        ///<Summary>
        /// 仓库代码
        ///</Summary>
        public string WarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_warehouseCode) ? string.Empty : _warehouseCode; }
            set { _warehouseCode = value; }
        }

        ///<Summary>
        /// 仓库名称
        ///</Summary>
        public string WarehouseName
        {
            get { return string.IsNullOrWhiteSpace(_warehouseName) ? string.Empty : _warehouseName; }
            set { _warehouseName = value; }
        }

        ///<Summary>
        /// 数量
        ///</Summary>
        public decimal? Count { get; set; }

        /// <summary>
        /// 发货单状态
        /// </summary>
        public Enum.DeliveryStatus Status { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 发货单
        /// </summary>
        public virtual DbSet<DeliveryOrder> DeliveryOrders { get; set; }
    }
}